package com.zhao.controller;

import com.zhao.entity.Position;
import com.zhao.service.PositionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("position")
public class PositionController {

    @Autowired
    private PositionService positionService;

    @GetMapping("findAll")
    List<Position> findAll() {
        return positionService.findAll();
    }

    @GetMapping("updatePositionName/{id}/{name}")
    void updatePositionName(@PathVariable("id") String id, @PathVariable("name") String name) {
        positionService.updatePositionName(id, name);
    }
}
